home *** CD-ROM | disk | FTP | other *** search
- Path: bignews.shef.ac.uk!usenet
- From: E.V.Smith@shef.ac.uk (Ez)
- Newsgroups: comp.lang.c++
- Subject: Help, holding HEX values in struct
- Date: 29 Feb 1996 15:40:59 GMT
- Organization: Automatic Control & Systems Engineering, University of Sheffield , UK
- Message-ID: <4h4heb$a4b@bignews.shef.ac.uk>
- NNTP-Posting-Host: pc022085.shef.ac.uk
- X-Newsreader: WinVN 0.92.1
-
- I am wanting to hold information in a structure.
- One piece of info is a pair of hex address for use with 'inport' commands.
- My question is, what is the best type to define these as to hold them.
- In one case I defined it and it caused all info on the line after the HEX
- to be totally ignored on initialising the struct.
-
- So what does inport want? is it a type INT or Char or another.
-
- The struct I'm playing with should be below.
-
- thanks for any help.
- replies via email appreciated.
- Eric..
-
-
- struct ports
- {
- char name[8];
- char port_adr[5]; /// what is the correct way!
- char byte_adr[5]; /// ^^^^^^^^^^^^^^^^^^^^^^^^
- int port_state;
- int shift_fact;
- int Xpos;
- int Ypos;
- };
-
- ports info[]=
- {
- {"sensor1","0x00","0x00",0,1,109,119},
- {"sensor2","0x00","0x00",0,1,109,179},
- {"sensor3","0x00","0x00",0,1,109,239},
- {"sensor4","0x00","0x00",0,1,109,299},
- {"sensor5","0x00","0x00",0,1,109,359},
-
- {"Lpush1Re","0x00","0x00",0,1,400,280},
- {"Lpush1Ex","0x00","0x00",0,1,455,280},
- {"Lpush2Re","0x00","0x00",0,1,400,320},
- {"Lpush2Ex","0x00","0x00",0,1,455,320},
-
- {"Lpull1Re","0x00","0x00",0,1,400,360},
- {"Lpull1Ex","0x00","0x00",0,1,455,360},
- {"Lpull2Re","0x00","0x00",0,1,400,400},
- {"Lpull2Ex","0x00","0x00",0,1,455,400}
- };
-
-